#include "currtime.h"
#include "ui_currtime.h"

CurrTime::CurrTime(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::CurrTime)
{
    ui->setupUi(this);
    upTimer = new QTimer(this);
    QObject::connect(upTimer, &QTimer::timeout, this, &CurrTime::updateTime);
    upTimer->start(1000);
}

CurrTime::~CurrTime()
{
    delete ui;
}

void CurrTime::updateTime()
{
    ui->cTime->setText(QDateTime::currentDateTime().toString("yyyy/MM/dd hh:mm:ss"));
}
